package cn.z2huo.knowledge.basic.keyword.statickeyword.staticblock;

/**
 * <p>
 *
 * @author z2huo
 */
class StaticBlock {

    static int a = 12;

    static {
        System.out.println(a);
        a = 13;
        System.out.println(a);
        System.out.println();
    }

    static {
        b = 100;
        // 下面这一行编译不通过
        // Cannot read value of field 'b' before the field's definition
//        System.out.println(b);
    }

    static int b = 22;

    static {
        System.out.println(b);
        b = 23;
        System.out.println(b);
        System.out.println();
    }

    static {
        int c = 33;
        System.out.println(c);
        System.out.println();
    }

    public static void main(String[] args) {
        new StaticBlock();
    }

}
